package com.itheima.shoppingmall.pay;

import java.util.Scanner;

public class PaySystem {
    private PayInterface payInterface;

    public PaySystem() {
    }

    public PaySystem(PayInterface payInterface) {
        this.payInterface = payInterface;
    }

    public PayInterface getPayInterface() {
        return payInterface;
    }

    public void setPayInterface(PayInterface payInterface) {
        this.payInterface = payInterface;
    }
//支付操作
    public void doPay(){
        if (payInterface !=null){
            //调用支付方式

            System.out.println("请输入支付金额");
            Scanner scanner=new Scanner(System.in);
            payInterface.pay(scanner.nextDouble());
        }else {
            System.out.println("请选择支付方式");
        }
   }


}
